package main

import (
	"fmt"
	"strings"
	"unicode"
)

//统计每个单词出现的次数  "how do you do your homework"

func main() {
	a1 := "how do you do your homework"
	a2 := strings.Split(a1, " ")
	//fmt.Println(a2)
	s2 := make(map[string]int, 10)
	for _, v := range a2{
		_, Isok := s2[v]
		if !Isok{
			s2[v] = 1
		}else {
			s2[v] += 1
		}
	}
	fmt.Println(s2)

	// 1.判断字符串中汉字的数量
	// "hello 招生是"
	n := "hello 招生是"
	var count int
	for _, x := range n {
		if unicode.Is(unicode.Han, x) {
			count++
		}
	}
	fmt.Println(count)
}
